﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            DirectoryInfo directoryInfo = new DirectoryInfo("D：\\msSolo");
            directoryInfo.Create();
            FileInfo fileInfo = new FileInfo("D：\\msSolo\\test.txt");
            if (!fileInfo.Exists)
            {
                fileInfo.Create().Close();

            }
            else
            {
                Console.WriteLine("已经有这个了文件夹了！");
            }

            string Path = @"D：\\msSolo\\test.txt";
            StreamWriter str = new StreamWriter(Path);

            str.WriteLine("光辉岁月");
            str.WriteLine("讲不出说再见");
            str.WriteLine("处处吻");
            str.WriteLine("Dancing With Your Ghost");
            str.WriteLine("少女的祈祷");
            str.Flush();
            str.Close();



            string Path1 = @"D:\\Ingrams";
            try
            {
                if (!Directory.Exists(Path1))
                {
                    Directory.CreateDirectory(Path1);


                }
                using (StreamWriter str2 = new StreamWriter("D:\\Ingrams\\test.txt", true))
                {
                    str2.WriteLine("光辉岁月");
                    str2.WriteLine("讲不出说再见");
                    str2.WriteLine("处处吻");
                    str2.WriteLine("Dancing With Your Ghost");
                    str2.WriteLine("少女的祈祷");



                }
            }
            finally { }



        }
    }
}
